home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Emulators / v2600 / Source.lha / Source / c26def.h < prev    next >
C/C++ Source or Header  |  1997-01-27  |  3KB  |  102 lines

  1. #ifndef C26DEF_H
  2. #define C26DEF_H
  3.  
  4. /* 
  5.    Common 2600 (.c26) format v1.0 specification
  6.    -------------------------------------
  7.    Alex Hornby, ahornby@zetnet.co.uk
  8.  
  9.  
  10.    Introduction
  11.    ============
  12.  
  13.    Common 2600 file format definitions. For discussion and suggestions for 
  14.    improvement, e-mail ahornby@zetnet.co.uk. I would like to see a fully
  15.    comprehensive 2600 file format develop so please copy this structure
  16.    and use it in your emulators.
  17.  
  18.    The format has been developed due to the multitude of different banking
  19.    schemes for 2600 cartridges, along with the need to select an appropriate
  20.    control device for each game. Using the .c26 format you will be able to
  21.    load games without giving loads of command line switches. 
  22.  
  23.    Philosophy
  24.    ==========
  25.    To avoid the format splitting into several competing ones, please do
  26.    not alter the format without discussing it first. I'm not trying to be
  27.    bossy, just to keep the common format truly common. 
  28.  
  29.    Tags
  30.    ====
  31.    The format is tagged so as to be extensible and allow both forward and
  32.    backward compatibility. It also means that information that is not 
  33.    needed or known does not have to be stored. e.g. If the cartridge image
  34.    is not a saved game then I do not need the game state tags.
  35.  
  36.    The format is a system of tags each being a tag type and the length of
  37.    data in that section. If a tag is not recognised then it should
  38.    be ignored. Each tag is a zero terminated string followed by a 32bit 
  39.    signed integer describing the length. If the tag is small the the length
  40.    integer can constitute the data item.
  41.  
  42.    Case is NOT important in tag names 
  43.  
  44.    Cross Platform Notes
  45.    ====================
  46.    Note that integers are stored in the Intel/DEC Alpha style. 
  47.    All strings are zero terminated .
  48. */
  49.  
  50. /* 
  51.    Defined TAGS
  52.    ============
  53.    
  54.    + Audit tags: All files should include these tags at the start of the file. 
  55.       
  56.    VERSION: Gives file format version as an integer. Currently 1
  57.    WRITER: Name of program that wrote file.
  58.    
  59.    + Cartridge Information tags: useful for collectors.
  60.    
  61.    CARTNAME: Name of cartridge.
  62.    CARTMAN:  Manufacturer of cartridge.
  63.    CARTAUTHOR: Name of programmer/programming team who wrote cartridge.
  64.    CARTSERIAL: Serial number of the cartridge.
  65.    
  66.    + Cartridge operation tags: necessary for the running of the game.   
  67.    
  68.    TVTYPE:     integer, 0=NTSC 1=PAL.
  69.    CONTROLLERS: Left controller BYTE then  Right controller BYTE.
  70.    BANKING:    Bank switching scheme.
  71.    DATA:       Cartridge ROM data.
  72.    
  73.    + Game state tags: used for saved games.
  74.    
  75.    CPUREGS:  CPU registers.
  76.    GAMEREGS: TIA and PIA registers.
  77.    PIARAM:   The 128 bytes of RAM from the PIA.
  78.  
  79.    CARTRAM:  Cartridge RAM, if supported by the BANKING type
  80.    
  81.    */
  82. enum TAGTYPE { VERSION=-1, WRITER=1, 
  83.                CARTNAME=2, CARTMAN=3, CARTAUTHOR=4, CARTSERIAL=5,
  84.                TVTYPE=-2, CONTROLLERS=-3, BANKING=-4, DATA=6,
  85.                CPUREGS=7, GAMEREGS=8, PIARAM=9, CARTRAM=10 };
  86.  
  87. char *tag_desc[]={ "VERSION", "WRITER", 
  88.            "CARTNAME", "CARTMAN", "CARTAUTHOR", "CARTSERIAL",
  89.            "TVTYPE", "CONTROLLERS", "BANKING", "DATA",
  90.            "CPUREGS", "GAMEREGS", "PIARAM", "CARTRAM"};
  91.  
  92.  
  93. /* Tag structure */
  94.  
  95. struct c26_tag {
  96.     int type;
  97.     int len;
  98. };
  99.  
  100.  
  101. #endif
  102.